package com.zhao.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhao.system.poro.Book;
import com.zhao.system.mapper.BookMapper;
import com.zhao.system.service.BookService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xiaozhao
 * @since 2020-11-08
 */
@Service
public class BookServiceImpl extends ServiceImpl<BookMapper, Book> implements BookService {
    @Autowired
    private BookMapper bookMapper;
    @Override
    public IPage<Book> getBookPage(Page<Book> page, QueryWrapper<Book> wrapper) {
        return this.baseMapper.getBookPage(page,wrapper);
    }

    @Override
    public IPage<Book> getBooks(Page<Book> page, QueryWrapper<Book> wrapper) {
        return baseMapper.getBooks(page,wrapper);
    }

    @Override
    public int del(Integer bid) {
        int del = bookMapper.del(bid);
        return del;
    }

    @Override
    public Book findByBid(Integer bid) {
        return bookMapper.findByBid(bid);
    }

    @Override
    public void updateNum(Integer bid, Integer num) {
        bookMapper.updateNum(bid,num);
    }


}
